﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Routing;
using System.Web;

namespace MvcEngine.Core.HttpHandlers
{
    public class FileRouteHandler : IRouteHandler
    {
        private IFileResolver fileResolver = null;

        public FileRouteHandler(IFileResolver fileResolver)
        {
            this.fileResolver = fileResolver;
        }
        
        #region IRouteHandler Members

        public IHttpHandler GetHttpHandler(RequestContext requestContext)
        {
            return new FileHandler(requestContext.RouteData, fileResolver);
        }

        #endregion

        #region IRouteHandler Members

        IHttpHandler IRouteHandler.GetHttpHandler(RequestContext requestContext)
        {
            return GetHttpHandler(requestContext);
        }

        #endregion
    }
}
